package io.github.talelin.latticy.service.K;

import io.github.talelin.autoconfigure.exception.NotFoundException;
import io.github.talelin.latticy.dto.K.BExceptionDTO;
import io.github.talelin.latticy.model.K.BExceptionConfirmDO;
import io.github.talelin.latticy.mapper.K.BExceptionConfirmMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 状态：0、未确认；1、已确认 服务实现类
 * </p>
 *
 * @author generator@TaleLin
 * @since 2021-06-18
 */
@Service
public class BExceptionConfirmService extends ServiceImpl<BExceptionConfirmMapper, BExceptionConfirmDO>{

    @Autowired
    private BExceptionConfirmMapper BExceptionConfirmMapper;

//    private MetaObjectHandler MetaObjectHandler;

    public void update(BExceptionDTO dto, Long id) {
        BExceptionConfirmDO BExceptionConfirmDO = this.getById(id);
        if (BExceptionConfirmDO == null) {
            throw new NotFoundException(70000);
        }
        BeanUtils.copyProperties(dto, BExceptionConfirmDO);
//        MetaObjectHandler.setFieldValByName("update_time", new Date(), dto);
        this.updateById(BExceptionConfirmDO);
    }
}
